import base64

# base64加密及解密

"""
加密
"""


def Jiami(jiami):
    # 转成bytes string
    bytesString = jiami.encode(encoding="utf-8")


    # base64 编码
    encodestr = base64.b64encode(bytesString)


    return encodestr.decode()


"""
解密
"""


def Jiemi(jiemi):
    # 解码
    decodestr = base64.b64decode(jiemi)

    return  decodestr.decode()


if __name__ == '__main__':
    str1 = 'mysql'# TXlzcWw=

    #
    a=Jiami(str1)
    print(a)

    #str2 = 'KnJyUm91NnhoNExTSFlJUQ=='
   # Jiemi(str2)
